// 微信接口
const WX = require('express').Router();

// 微信小程序轮播图
WX.get('/banners', require('./action/banner/find'));
// 首页导航链接
WX.get('/links', require('./action/link/find'));
// 用户注册
WX.post('/register', require('./WX/user/register'));
// 查询所有分类
WX.get('/categories', require('./WX/category/categories'));
// 根据一级查询下级分类
WX.get('/getCategoryById', require('./WX/category/getCategoryById'));
// 商品
WX.get('/getGoods', require('./WX/good/getGood'));
// 根据三级分类id获取商品
WX.get('/getGoodsByid', require('./WX/good/getGoodsById'));
// 根据商品名称获取商品
WX.get('/getGoodsByName', require('./WX/good/getGoodsByName'));
// 根据三级分类id获取商品
WX.get('/getGoodsDetail', require('./WX/good/getGoodsDetail'));
// 获取一级分类
WX.get('/getCategory', require('./WX/good/getCategory'));
// 添加购物车
WX.post('/joinCart', require('./WX/cart/joinCart'));
// 查询用户购物车
WX.get('/getCart', require('./WX/cart/getCart'));
// 删除购物车
WX.delete('/delCart', require('./WX/cart/delCart'));
// 用户地址
WX.use('/address', require('./address'));
// 修改用户信息
WX.put('/editUser', require('./WX/user/modifyInfo'));
// 创建订单
WX.post('/createOrder', require('./WX/order/createOrder'));
// 创建支付
WX.post('/orderPay', require('./WX/order/orderPay'));
// 获取用户订单
WX.get('/getUserOrder', require('./WX/order/getUserOrder'));
// 收货
WX.put('/receivingGoods', require('./WX/order/receivingGoods'));
// 评价
WX.post('/estimate', require('./WX/order/estimate'));
// 取消订单
WX.delete('/cancelOrder', require('./WX/order/cancelOrder'));
// 商品收藏
WX.post('/collect', require('./WX/collect/collect'));
// 获取商品收藏数据
WX.get('/getCollect', require('./WX/collect/getCollect'));
// 获取用户是否收藏数据
WX.get('/isCollect', require('./WX/collect/is_collect'));

module.exports = WX;
